<template>
	<view class="cardPaySuccess">
		<n-loading></n-loading>
		<view v-if="orderInfo">
			<!-- 评价成功 -->
			<view class="paySuccessBox">
				<view class="paySuccess">
					<image src="../../static/img/paySuccess.svg"></image>
					<text>评价成功！</text>
				</view>
				<view class="goldCoinTip">
					<view class="integralTip">
						<view class="label">购物返金币</view>
						<text>恭喜获得1200金币</text>
					</view>
					<!-- 操作 -->
					<view class="handleBtn">
						<view class="btn" @tap="seeOrderInfo">查看订单</view>
						<view class="btn btn1" @tap="goHome">返回首页</view>
					</view>
				</view>
			</view>
			
			<view class="payEdInfo">
				<view class="payEdInfoLine"></view>
				<view class="payEdInfoCont">
					<view class="payEdInfoShadow"></view>
					<view class="infoContBox">
						
						<view class="cardMan">
							<view class="tit">{{orderInfo.store.name}}</view>
						</view>
						
						<view class="goodsCont" v-for="(goods,i) of orderInfo.items" :key='goods.id'>
							<dh-image class="niccImg" :src="goods.image"
							 errorSrc="https://lovebirdopen.com/static/img/cBj/dPicture.png"></dh-image>
							<view class="goodsInfo">
								<view class="tit">
									<view class="titleft ellipsis">{{goods.name}}</view>
									<text>￥{{goods.price}}</text>
								</view>
								<view class="specsBox">
									<view class="specs">{{goods.specs}}</view>
									<text>×{{goods.num}}</text>
								</view>
							</view>
						</view>
						
						<view class="infoEach"><text>支付金额：</text>￥{{orderInfo.pay_amount}}</view>
						<view class="infoEach"><text>订单编号：</text>{{orderInfo.id}}</view>
						<view class="infoEach pb34"><text>下单时间：</text>{{getdate(orderInfo.created_at,1)}}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				orderInfo:null,
				order_id:null,
			}
		},
		onLoad: function (option) {
			this.order_id = option.id;
			this.getOrderInfo(option.id);
		},
		methods: {
			getOrderInfo(id){
				this.apiget('/fun/order/view',{id:id}).then(res =>{
					if(res.data.status == 200 ) {
						this.orderInfo = res.data.data;
					}
				})
			},
			seeOrderInfo(){
				uni.navigateTo({
					url: './orderInfoSucceed?id='+this.order_id
				});
			},
			goHome(){
				uni.reLaunch({
				    url: '../index?barCur=0'
				});
			}
			
		}
	}
</script>

<style lang="scss">
	.cardPaySuccess{
		min-height: 100%;
		padding-bottom: 130rpx;
		background-color: #F8F8FA;
	}
	
	.paySuccessBox{
		background: linear-gradient(180deg, #F3512E 19.79%, #F4752D 100%);
	}
	
	.paySuccess{
		width: 100%;
		height: 120rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
		justify-content: center;
		
		image{
			width: 120rpx;
			height: 120rpx;
			margin-right: 16rpx;
		}
		
		text{
			font-size: 36rpx;
			color: #FFFFFF;
		}
	}
	
	.cardTips{
		padding-bottom: 26rpx;
		font-size: 24rpx;
		line-height: 40rpx;
		color: #fff;
		text-align: center;
		
	}
	
	.goldCoinTip{
		// height: 104rpx;
		padding: 0 32rpx 64rpx;
				
		.integralTip{
			display: flex;
			justify-content: center;
			height: 40rpx;
			box-sizing: border-box;
			
			.label{
				width: 136rpx;
				height: 40rpx;
				font-size: 24rpx;
				line-height: 40rpx;
				text-align: center;
				color: #FFFFFF;
				background: linear-gradient(264.11deg, #FF8C4B 9.33%, #F4BE6D 94.67%);
				border: 1rpx solid #FFA24B;
				box-sizing: border-box;
				border-radius: 8rpx;
			}
			
			text{
				margin-left: 24rpx;
				font-size: 24rpx;
				line-height: 40rpx;
				color: #fff;
			}
		}
	}
	
	.payEdInfo{
		padding: 0 22rpx;
		margin-top: -50rpx;
		margin-bottom: 32rpx;
		
		.payEdInfoLine{
			height: 20rpx;
			background: linear-gradient(180deg, #E93C16 0%, #F04925 100%);
			border-radius: 12rpx;
		}	
		
		.payEdInfoCont{
			position: relative;
			padding: 0 10rpx;
			margin-top: -10rpx;
		
			.payEdInfoShadow{
				position: absolute;
				top: 0;
				left: 0;
				width: 100%;
				height: 16rpx;
				background: linear-gradient(180deg, rgba(208, 27, 0, 0.2) 0%, rgba(208, 27, 0, 0) 51.04%);
			}
			
			.cardMan{
				display: flex;
				margin-bottom: 16rpx;
				line-height: 52rpx;
				
				.tit{
					flex: 1;
					width: 1px;
					font-size: 32rpx;
					font-weight: 900;
					color: #333333;
				}
				
				.btn{
					font-size: 24rpx;
					color: #666666;
				}
			}
			
			.goodsCont{
				margin-bottom: 26rpx;
				padding: 16rpx 24rpx;
				display: flex;
				background: rgba(64, 169, 255, 0.1);
				border-radius: 16rpx;
				
				.niccImg {
					width:96rpx;
					height: 96rpx;
					margin-right: 24rpx;
					border-radius: 8rpx;
				}
				
				.goodsInfo{
					flex: auto;
					line-height: 40rpx;
					
					.tit{
						display: flex;
						margin-bottom: 16rpx;
						font-size: 24rpx;
						color: #666;
						
						.titleft{
							flex: auto;
							width: 1px;
						}
					}
					
					.specsBox{
						display: flex;
						font-size: 24rpx;
						color: #999;
						
						.specs{
							flex: auto;
						}
					}
				}
			}
			
			
			.cardHandle{
				padding: 20rpx 0;
				display: flex;
				margin-bottom: 16rpx;
				border-bottom: 1rpx dashed #F5F5F5;
				
				.handleEach{
					height: 56rpx;
					line-height: 56rpx;
					font-size: 24rpx;
					text-align: center;
					
					.handleBox{
						display: flex;
						align-items: center;
						justify-content: center;
						
						image{
							display: inline-block;
							width: 32rpx;
							height: 32rpx;
							margin-top: -4rpx;
							margin-right: 10rpx;
							vertical-align:middle
						}
					}
				}
				.handleEach1{
					width: 244rpx;
					border: 2rpx solid #FF5238;
					box-sizing: border-box;
					border-radius: 56rpx;
					color: #FF5238;
				}
				.handleEach2{
					flex: 1;
					// width: 184rpx;
					margin-left: 16rpx;
					background: linear-gradient(276.81deg, #FF5238 8.46%, #FFA360 89.67%), linear-gradient(96.27deg, #EAC181 6.37%, #A6834D 92.17%);
					border-radius: 50rpx;
					color: #FFF;
				}
			}
			
			.useRule{
				margin-bottom: 18rpx;
				background-color: #fff;
				border-radius: 16rpx;
				border-bottom: 1rpx dashed #F5F5F5;
				
				.useRuleTit{
					font-size: 32rpx;
					line-height: 56rpx;
					color: #333;
				}
				
				.seeDesirable{
					padding: 4rpx 0;
					display: flex;
					align-items: center;
					
					.left{
						flex: auto;
						
						.tit{
							font-size: 28rpx;
							line-height: 44rpx;
							color: #333;
							
							text{
								display: inline-block;
								padding: 0 16rpx;
								margin-left: 8rpx;
								font-size: 24rpx;
								line-height: 40rpx;
								color: #FF5238;
								background: rgba(255, 82, 56, 0.12);
								border-radius: 40rpx;
							}
						}
						
						.tips{
							font-size: 24rpx;
							line-height: 40rpx;
							color: #999;
						}
					}
				
				}
				
				.mapBox{
					height: 236rpx;
					background-color: #F8F8FA;
				}
					
				.distance{
					height: 64rpx;
					font-size: 24rpx;
					line-height: 64rpx;
					color: #333;
				}
			}
			
			
			.infoContBox{
				padding: 48rpx 32rpx 0;
				background: #FFFFFF;
				box-shadow: 0px 4rpx 8rpx rgba(0, 0, 0, 0.03);
				border-radius: 0px 0px 8rpx 8rpx;
				
				.infoEach{
					margin-bottom: 20rpx;
					font-size: 24rpx;
					line-height: 40rpx;
					color: #333;
					
					text{
						margin-right: 40rpx;
						color: #666666;
					}
				}
				
				.pb34{
					padding-bottom: 34rpx;
				}
				
				.seeOrderInfo{
					display: flex;
					height: 72rpx;
					font-size: 24rpx;
					line-height: 72rpx;
					border-top: 1rpx dashed #F5F5F5;
					
					.knowCard{
						width: 160rpx;
						color: #999;
						
						.u-icon{
							margin-right: 8rpx;
						}
					}
					
					.seeOrder{
						flex: 1;
						margin-left: 150rpx;
						text-align: right;
						
						.u-icon{
							margin-left: 8rpx;
						}
					}
					
				}
			}
		}
	}
	
	
	
	.payTimeTipsBox{
		padding: 0 32rpx;
		position: fixed;
		bottom: 48rpx;
		left: 0;
		width: 100%;
		
		.payTimeTips{
			display: flex;
			height: 80rpx;
			padding: 0 24rpx;
			line-height: 80rpx;
			font-size: 24rpx;
			color: #7B5D34;
			text-align: center;
			background: #FFF3DD;
			border-radius: 16rpx;
			
			.tips{
				flex: 1;
				width: 1px;
			}
			
			.close{
				width: 32rpx;
				text-align: right;
			}
		}
	}
	
	.handleBtn{
		margin-top: 24rpx;
		padding-top: 24rpx;
		text-align: center;
		border-top: 1rpx dashed rgba(255, 255, 255, 0.7);
		
		.btn{
			display: inline-block;
			height: 56rpx;
			padding: 0 32rpx;
			margin: 0 12rpx;
			line-height: 56rpx;
			font-size: 24rpx;
			color: #fff;
			border: 2rpx solid #fff;
			border-radius: 60rpx;
		}
		
		.btn1{
			background-color: #fff;
			color: #FF5238;
		}
	}
	

	.continue{
		width: 176rpx;
		height: 60rpx;
		margin: 0 auto;
		font-size: 24rpx;
		line-height: 60rpx;
		text-align: center;
		color: #FFFFFF;
		background: #FF5238;
		border-radius: 52rpx;
	}
	
	.cSuccess{
		padding: 32rpx 0;
		background-color: #fff;
		text-align: center;
		
		.cSuccessTip{
			margin-bottom: 16rpx;
			font-size: 32rpx;
			line-height: 48rpx;		
				
			text{
				margin-left: 16rpx;
				color: #FF5238;
			}
		}
		.backHome{
			display: inline-block;
			padding: 16rpx 40rpx;
			border: 2rpx solid #FF5238;
			border-radius: 30rpx;
			font-size: 24rpx;
			line-height: 28rpx;
			color: #FF5238;
		}
		.seeOrder{
			display: inline-block;
			margin-right: 32rpx;
			padding: 16rpx 40rpx;
			border: 2rpx solid #999999;
			border-radius: 30rpx;
			font-size: 24rpx;
			line-height: 28rpx;
			color: #666666;
		}
	}
	.moreRecommend{
		padding: 24rpx 32rpx;
		
		.title{
			position: relative;
			font-size: 32rpx;
			line-height: 48rpx;
			color: #333;
		}
		.shoppingList{
			display: flex;
			padding-top: 24rpx;
			align-items: center;
			flex-wrap: wrap;
			justify-content: space-between;
			flex-direction: row;
			
			.shoppingEach{
				margin-bottom: 16rpx;
				background-color: #FFFFFF;
				border-radius: 8rpx;
				overflow: hidden;
				
				image {
					display: block;
					width: 334rpx;
					height: 350rpx;
				}
				
				.iGoodsInfo{
					padding:8rpx 16rpx 12rpx;
					
					.iGoodsName{
						font-size: 24rpx;
						line-height: 40rpx;
					}
					.payers{
						margin-bottom: 18rpx;
						font-size: 24rpx;
						color: #666;
					}
					.priceInfo{
						font-weight: 600;
						font-size: 28rpx;
						line-height: 44rpx;
						color: #FF5238;
						
						text{
							font-size: 22rpx;
							color: rgba(0, 0, 0, 0.3);
							text-decoration:line-through;
						}
					}
				}
			}
		}
	}

	.mask{
		position: fixed;
		top: 0;
		left: 0;
		z-index: 9999;
		width: 100%;
		height: 100%;
		background: rgba(0, 0, 0, 0.4);
	}
	
	.wishPopup{
		position: fixed;
		top: 18%;
		left: 50%;
		z-index: 10000;
		width: 646rpx;
		margin-left: -323rpx;
		
		.box{
			position: relative;
			height: 588rpx;
			// background-color: #fff;
			
			.bj1{
				position: absolute;
				top: 0;
				left: 0;
				width: 636rpx;
				height: 570rpx;
			}
			
			.wishWords{
				position: absolute;
				top: 72rpx;
				left: 154rpx;
				z-index: 1;
				font-size: 36rpx;
				line-height: 28rpx;
				color: #FFFFFF;
				text-shadow: 0px 0px 4px #E19A45;
			}
			
			.popCard{
				position: absolute;
				top: 150rpx;
				left: 66rpx;
				z-index: 2;
				width: 538rpx;
				height: 352rpx;
				border-radius: 16rpx;
				box-shadow: 0px 8rpx 16rpx 0px 0,0,0,0.08;
			}
			
			.popCardCont{
				position: absolute;
				top: 150rpx;
				left: 66rpx;
				z-index: 3;
				width: 538rpx;
				height: 352rpx;
				
				.contBox{
					width: 100%;
					height: 100%;
					position: relative;
					padding: 40rpx;
					
					.worth{
						position: absolute;
						top: 10rpx;
						right: 0;
						width: 233rpx;
						padding-left: 77rpx;
						font-size: 24rpx;
						line-height: 34rpx;
						color: #755F3C;
					}
					
					.worth1{
						color: #FFE6A6;
					}
					
					.tit{
						font-size: 32rpx;
						line-height: 52rpx;
						color: #EAC181;
					}
					
					.tit1{
						color: #B97300;
					}
					
					.time{
						width: 320rpx;
						font-size: 24rpx;
						line-height: 40rpx;
						color: rgba(234, 193, 129, 0.7);
					}
					
					.time1{
						color: rgba(185, 115, 0, 0.7);
					}
					
					.mt56{
						margin-top: 56rpx;
					}
				}
			}
			
			.bj2{
				position: absolute;
				bottom: 0;
				right: -2rpx;
				z-index: 8;
				width: 614rpx;
				height: 254rpx;
			}
			
			.handleBox1{
				position: absolute;
				bottom: 70rpx;
				left: 32rpx;
				z-index: 9;
				width: 602rpx;
				text-align: center;
				
				.btn{
					height: 56rpx;
					line-height: 56rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					
					image{
						display: inline-block;
						width: 32rpx;
						height: 32rpx;
						margin-top: -4rpx;
						margin-right: 10rpx;
						vertical-align:middle
					}
				}
				.btn1{
					display: inline-block;
					width: 144rpx;
					border: 2rpx solid #fff;
					box-sizing: border-box;
					border-radius: 56rpx;
					color: #fff;
				}
				.btn2{
					display: inline-block;
					width: 218rpx;
					margin-left: 16rpx;
					background: linear-gradient(276.81deg, #FF5238 8.46%, #FFA360 89.67%), linear-gradient(96.27deg, #EAC181 6.37%, #A6834D 92.17%);
					border-radius: 50rpx;
					color: #FFF;
					box-shadow: 0px 2px 4px rgba(255, 82, 56, 0.5);
				}
			}
		}
		
		.close{
			width: 40rpx;
			height: 40rpx;
			margin: 70rpx auto 0;
			
			image{
				width: 100%;
				height: 100%;
			}
		}
	}

	
	
	//分享方式
	.shareWaysBox {
		padding: 64rpx 32rpx;
	
		.shareWays {
			display: flex;
			padding-bottom: 60rpx;
			text-align: center;
	
			.shareWaysEach {
				flex: 1;
	
				.shareFriendsBtn {
					border: none;
				}
	
				.shareWaysEachIcon {
					display: flex;
					align-items: center;
					justify-content: center;
					height: 112rpx;
					width: 112rpx;
					margin: 0 auto;
					background: #F7F7F7;
					border-radius: 8rpx;
				}
	
				.tit {
					margin-top: 16rpx;
					font-size: 24rpx;
					line-height: 40rpx;
					color: #999999;
				}
			}
		}
	
		.cancel {
			height: 96rpx;
			font-size: 32rpx;
			line-height: 96rpx;
			text-align: center;
			color: #333;
			background: #F7F7F7;
			border-radius: 48px;
		}
	}
	
	.goodsPainter {
		width: 460rpx;
		height: 900rpx;
		padding: 112rpx 0;
		margin: 0 auto;
		
		image{
			width: 460rpx;
			height: 674rpx;
		}
	}
	
	.painterCans {
		position: fixed;
		left: -800rpx;
		width: 640rpx;
		height: 1028rpx;
	}
	
	.savePainter {
		margin-top: 20rpx;
		padding: 0 32rpx 30rpx;
	
		.saveBtn {
			height: 96rpx;
			font-size: 32rpx;
			line-height: 96rpx;
			color: #fff;
			text-align: center;
			background: #FF5238;
			box-shadow: 0px 4rpx 8rpx rgba(255, 82, 56, 0.18);
			border-radius: 48rpx;
		}
	}

</style>
